package com.wedimob.slideshare.bo;

import java.net.URL;
import java.util.Calendar;

import com.wedimob.slideshare.parser.annotation.HTMLMapping;
import com.wedimob.slideshare.parser.annotation.HTMLMappings;
import com.wedimob.slideshare.source.SlideShareStrategy;

public class Summary extends AbstractBO<Summary> {

    @HTMLMappings(
            mappings =
            {
                    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "a.slideshow-title", attr = "href"),
                    @HTMLMapping(url = SlideShareStrategy.USER_DOC_PAGE_PATTERN, tag = "a.j-imageanchor", attr = "href"),
            })
    private URL url;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "span.h-stats")
    private Integer slidenb;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "a.slideshow-title")
    private String title;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "span.description")
    private String summary;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "span.slideshow-owner-name")
    private String author;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "span.slideshow-posted-at")
    private Calendar publicationDate;

    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "span.category")
    private String category;

    @HTMLMappings(
            mappings =
            {
                    @HTMLMapping(url = SlideShareStrategy.SEARCH_PATTERN, tag = "img.slideshow-thumbnail", attr = "src"),
                    @HTMLMapping(url = SlideShareStrategy.USER_DOC_PAGE_PATTERN, tag = "img.thumbnail", attr = "src"),
            })
    private Medium picture;

    public Summary() {
        super();
    }

    public Summary(URL url) {
        super();
        this.url = url;
    }

    public Summary(URL url, Integer slidenb, String title, String summary, String author,
            Calendar publicationDate, String category, Medium picture) {
        super();
        this.url = url;
        this.slidenb = slidenb;
        this.title = title;
        this.summary = summary;
        this.author = author;
        this.publicationDate = publicationDate;
        this.category = category;
        this.picture = picture;
    }

    public URL getUrl() {
        return url;
    }

    public void setUrl(URL url) {
        this.url = url;
    }

    public Integer getSlidenb() {
        return slidenb;
    }

    public void setSlidenb(Integer slidenb) {
        this.slidenb = slidenb;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Calendar getPublicationDate() {
        return publicationDate;
    }

    public void setPublicationDate(Calendar publicationDate) {
        this.publicationDate = publicationDate;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public Medium getPicture() {
        return picture;
    }

    public void setPicture(Medium picture) {
        this.picture = picture;
    }
}
